#ifndef HTMLTABLE_H
#define HTMLTABLE_H
#include <QString>
#include <QList>
#include <QVariant>
#include <QFile>
#include <QTextStream>
#include <QIODevice>

enum Align{LEFT = 0, CENTER, RIGHT};


class HtmlTable
{

public:
    explicit HtmlTable();
    ~HtmlTable();

public:

    QString ToHtmlTableString();
    void    Clear();

    void SetCaption(QString caption);
    void SetWidth(int width);
    void SetBorder(float border);
    void SetCellPadding(unsigned int cp);
    void SetAlign(Align align);

    void BeginTh();
    void EndTh();
    void AddTh(QString th);

    void BeginTr();
    void EndTr();
    void AddTd(QVariant td); //

private:
    QString      sCaption;
    int          nWidth;
    float        fBorder;
    unsigned int nCellPadding;
    Align        eAlign;

    QString sTable; //
    QString sTh;    //<th>*****</th>
    QString sTr;    //<tr>*****</tr>

};

#endif // HTMLTABLE_H
